package com.cy.pj.goods.dao;


import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class GoodsDaoImpl implements GoodsDao{

    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    @Override
    public List<Goods> findGoods() {
        SqlSession session=sqlSessionFactory.openSession();
        String statement="com.cy.pj.goods.dao.GoodsDao.findGoods";
        List<Goods> list=session.selectList(statement);
        session.close();
        return list;
    }
}
